const express = require('express');
const router = express.Router();
const Banner = require('../../models/vue-app/banner');

// 获取轮播图列表
router.get('/banners', async (req, res) => {
    try {
        const banners = await Banner.find();
        res.status(200).json(banners);
    } catch (error) {
        res.status(500).send('服务器错误');
    }
});

module.exports = router;